<template>
        <el-card shadow="never" style="max-height: 700px; overflow: auto">
            <el-form ref="form" :model="form" :rules="rules" label-width="90px" :disabled="disabled">
                <!-- <el-form-item label="id:" prop="id" v-show="false">
                    <el-input v-model="form.id" disabled />
                </el-form-item>
                <el-form-item label="订单编号:" prop="name">
                    <el-input v-model="form.name" placeholder="请输入订单编号" clearable />
                </el-form-item>
                <el-form-item label="订单时间(美国):" prop="created_at">
                    <el-input-number v-model="form.created_at" :step="1" :min="0"></el-input-number>
                </el-form-item>
                <el-form-item label="email:" prop="email">
                    <el-input v-model="form.email" placeholder="请输入email" clearable />
                </el-form-item>
                <el-form-item label="客户姓名:" prop="shipping_name">
                    <el-input v-model="form.shipping_name" placeholder="请输入客户姓名" clearable />
                </el-form-item>
                <el-form-item label="问题类型:" prop="one_kf">
                    <el-input v-model="form.one_kf" placeholder="请输入问题类型" clearable />
                </el-form-item>
                <el-form-item label="问题详情:" prop="two_kf">
                    <el-input v-model="form.two_kf" placeholder="请输入问题详情" clearable />
                </el-form-item> -->
                <el-form-item label="邮件详情:" prop="email_detail">
                    <el-input type="textarea" v-model="form.email_detail" placeholder="请输入邮件详情" clearable />
                </el-form-item>
                <!-- <el-form-item label="是否被标记:" prop="is_mark">
                    <el-input-number v-model="form.is_mark" :step="1" :min="0"></el-input-number>
                </el-form-item>
                <el-form-item label="标记时间:" prop="mark_time">
                    <el-date-picker v-model="form.mark_time" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择标记时间" />
                </el-form-item>         -->

                <el-table
                    :data="kfqustion"
                    style="width: 100%">
                    <el-table-column
                        prop="type_title"
                        label="问题描述"
                        width="">
                    </el-table-column>
                    <el-table-column
                        prop="typedetail_title"
                        label="问题详情">
                    </el-table-column>
                </el-table>

                <!-- <el-form-item>
                    <el-button type="primary" @click="submitForm">确认 </el-button>
                    <el-button type="warning" @click="cancel">取消 </el-button>
                </el-form-item> -->
            </el-form>
        </el-card>
</template>

<script>
export default {
    name: 'EditForm',
    props: {
        findFormData: {
            type: Object,
            default: {}
        },
        editFormParams: {
            type: Object,
            default: {}
        },
        // 表单是否禁用
        disabled: {
            type: Boolean,
            default: false,
        },
        
    },
    data() {
        return {
            // 编辑表单验证规则
            rules: {
                is_mark: [{ required: true, message: "请输入是否被标记", trigger: "blur" }],
                mark_time: [{ required: true, message: "请输入标记时间", trigger: "blur" }],
        
            },
            form: {  },
            kfqustion: [],
          

        }
    },
    watch: {
        findFormData: {
           handler(nval) {
                if (JSON.stringify(nval) != '{}') {
                    this.$nextTick(() => {
                        this.form = nval
                        this.kfqustion = nval.kfqustion
                    })
                }
            },
            immediate: true,
            deep: false,
        },
        
    },
    methods: {
        // 取消按钮
        cancel() {
            this.$emit('editFormCancel')
        },

        submitForm() {
            this.$refs['form'].validate((valid, obj) => {
                if (valid) {
                    this.$emit('submitForm', this.form)
                }
            })
        },

        // 表单重置
        reset() {
            this.resetForm('form')
        }
    }
}
</script>
